/*     */ package com.lmpop.trade.tb_orderaction;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Tb_orderactionInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Tb_orderactionInfo()
/*     */   {
/*  17 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     String result_code = "0";
/*     */     try {
/*  29 */       String subaction = map.getString("subaction");
/*     */ 
/*  31 */       if (subaction.equals("1"))
/*     */       {
/*  34 */         RandomID randomID = new RandomID();
/*  35 */         String order_old_state = map.getString("order_old_state");
/*  36 */         if (!order_old_state.equals("")) {
/*  37 */           String[] order_o_state = order_old_state.split(",");
/*  38 */           for (int i = 0; i < order_o_state.length; i++)
/*     */           {
/*  40 */             if (!order_o_state[i].equals("")) {
/*  41 */               String[] order_o = order_o_state[i].split("\\|");
/*  42 */               if (order_o.length != 2)
/*     */                 continue;
/*  44 */               Tb_orderaction tb_orderaction = new Tb_orderaction();
/*  45 */               tb_orderaction.setTrade_id(randomID.GenTradeId());
/*  46 */               tb_orderaction.setOrder_id(order_o[0]);
/*  47 */               tb_orderaction.setOrder_status(order_o[1]);
/*  48 */               tb_orderaction.setAction_desc(map.getString("action_desc"));
/*  49 */               tb_orderaction.setNext_date(map.getString("next_date"));
/*  50 */               tb_orderaction.setNext_desc(map.getString("next_desc"));
/*     */ 
/*  52 */               tb_orderaction.setUser_id(map.getString("session_user_id"));
/*  53 */               tb_orderaction.setAction_note("");
/*  54 */               insert(dbmMgr, tb_orderaction);
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/*  62 */       e.printStackTrace();
/*  63 */       result_code = "1";
/*     */     }
/*  65 */     map.setString("result_code", result_code);
/*  66 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Tb_orderaction tb_orderaction)
/*     */     throws ApplicationException
/*     */   {
/*  75 */     dbmMgr.update("insertTb_orderaction", tb_orderaction);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  85 */     String pkid_string = map.getString("pkid");
/*  86 */     String result_code = "0";
/*     */     try {
/*  88 */       if (!pkid_string.equals("")) {
/*  89 */         String[] pkStr = pkid_string.split("\\|");
/*  90 */         for (int i = 0; i < pkStr.length; i++) {
/*  91 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  95 */       e.printStackTrace();
/*  96 */       result_code = "1";
/*     */     }
/*  98 */     map.setString("result_code", result_code);
/*  99 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 108 */     dbmMgr.update("deleteTb_orderaction", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 117 */     Tb_orderaction tb_orderaction = new Tb_orderaction();
/* 118 */     tb_orderaction.setTrade_id(map.getString("trade_id"));
/* 119 */     tb_orderaction.setOrder_id(map.getString("order_id"));
/* 120 */     tb_orderaction.setOrder_status(map.getString("order_status"));
/* 121 */     tb_orderaction.setAction_desc(map.getString("action_desc"));
/* 122 */     tb_orderaction.setNext_date(map.getString("next_date"));
/* 123 */     tb_orderaction.setNext_desc(map.getString("next_desc"));
/* 124 */     tb_orderaction.setIn_date(map.getString("in_date"));
/* 125 */     tb_orderaction.setUser_id(map.getString("user_id"));
/* 126 */     tb_orderaction.setAction_note(map.getString("action_note"));
/*     */ 
/* 128 */     String result_code = "0";
/*     */     try {
/* 130 */       update(dbmMgr, tb_orderaction);
/*     */     } catch (ApplicationException e) {
/* 132 */       e.printStackTrace();
/* 133 */       result_code = "1";
/*     */     }
/* 135 */     map.setString("result_code", result_code);
/* 136 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Tb_orderaction tb_orderaction)
/*     */     throws ApplicationException
/*     */   {
/* 145 */     dbmMgr.update("updateTb_orderaction", tb_orderaction);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 155 */     Tb_orderaction tb_orderaction = (Tb_orderaction)obj;
/* 156 */     Map params = new Hashtable();
/* 157 */     if (start == 0)
/* 158 */       start = 0;
/*     */     else {
/* 160 */       start = (start - 1) * limit;
/*     */     }
/* 162 */     limit = start + limit;
/* 163 */     params.put("start", Integer.valueOf(start));
/* 164 */     params.put("end", Integer.valueOf(limit));
/*     */ 
/* 166 */     return this.queryList.getList("getListByTb_orderactionPage", params);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 177 */     Tb_orderaction tb_orderaction = (Tb_orderaction)obj;
/* 178 */     Map params = new Hashtable();
/*     */ 
/* 180 */     return 0;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 190 */     return this.queryList.getList("getTb_orderactionByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.tb_orderaction.Tb_orderactionInfo
 * JD-Core Version:    0.6.0
 */